const express = require('express');
const path = require('path');
const fs = require('fs');
let app=express();
app.listen(3000);


// 1、下载ejs模板引擎
// 2、设置模板引擎（view engine）
// app.set("view engine",模板引擎  )
app.set("view engine","ejs"  )


// 3、把views里面的html文件改为ejs文件



app.get("/list",(req,res)=>{

    // 学生信息
    let stu=[
        {name:"张三",age:18,sex:"女",score:100},
        {name:"李四",age:19,sex:"男",score:99},
        {name:"王五",age:20,sex:"女",score:98},
        {name:"赵六",age:21,sex:"男",score:97},
    ]


    res.render("list",{stu:stu })   
   
})

